package com.hjms.tenant.share;

import com.hjms.common.entity.exception.OpenFeignConfig;
import com.hjms.tenant.contracts.dto.tenant.AddTenantDto;
import com.hjms.tenant.contracts.vo.tenant.TenantVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 何杨谊
 * @description: TODO
 * @date 2023/1/2 13:40
 */
@FeignClient(value = "tenant-service", path = "/api/tenant",configuration = OpenFeignConfig.class)
public interface ITenantFeignService {

    /**
     * 获取租户
     * @param tenantId 租户id
     * @return
     */
    @GetMapping("{tenantId}")
    public TenantVo Get(@PathVariable(value = "tenantId") String tenantId);

    /**
     * 新增租户
     * @param dto
     * @return 租户id
     */
    @PostMapping
    public String Add(@RequestBody AddTenantDto dto);
}
